//
//  subCommentCell.m
//  LoveLove
//
//  Created by 吴志强 on 2019/6/26.
//  Copyright © 2019 wkf. All rights reserved.
//

#import "subCommentCell.h"

@implementation subCommentCell

- (void) setview
{
    self.img = UIImageView.new;
    self.img.frame = CGRectMake(15, 10, 50, 50);
    self.img.layer.cornerRadius = 25;
    self.img.clipsToBounds = YES;
    self.img.contentMode = UIViewContentModeScaleAspectFill;
    [self.contentView addSubview:self.img];

    self.contentTextLbl = [LLInitBaseViewTool labelWithText:nil textColor:UIColor.blackColor font:19 textAlignment:NSTextAlignmentLeft];
    self.contentTextLbl.frame = CGRectMake(self.img.right+15, self.img.top, LLScreenWidth-95, 20);
    [self.contentView addSubview:self.contentTextLbl];

    self.bottomInfoLbl = [LLInitBaseViewTool labelWithText:nil textColor:LLColorRGB(131) font:11 textAlignment:NSTextAlignmentLeft];
    self.bottomInfoLbl.frame = CGRectMake(self.img.right+15, self.contentTextLbl.bottom, LLScreenWidth-95, 20);
    [self.contentView addSubview:self.bottomInfoLbl];

    self.content_label = [LLInitBaseViewTool labelWithText:nil textColor:LLColorRGB(131) font:11 textAlignment:NSTextAlignmentLeft];
    self.content_label.frame = CGRectMake(self.img.right+15, self.bottomInfoLbl.bottom+10, LLScreenWidth-95, 60);
    self.content_label.numberOfLines = 0;
    [self.contentView addSubview:self.content_label];

    self.line = [[UIView alloc] initWithFrame:CGRectMake(0, self.content_label.bottom+10, LLScreenWidth, 0.5)];
    self.line.backgroundColor = [UIColor colorWithRed:230.0/255.0 green:230.0/255.0 blue:230.0/255.0 alpha:1];
    [self.contentView addSubview:self.line];
}

- (void) setData:(NSDictionary *)data
{
    _data = data;
    NSString *image_url = data[@"u_avatar"];
    if (image_url.length > 0) {
        [self.img sd_setImageWithURL:LLImageWithUrl(image_url) placeholderImage:[UIImage imageNamed:@"placeholder"] options:SDWebImageRefreshCached];
    }
    self.contentTextLbl.text = [NSString stringWithFormat:@"%@",data[@"u_name"]];
    self.bottomInfoLbl.text = [NSString stringWithFormat:@"%@",data[@"time"]];
    self.content_label.text = [NSString stringWithFormat:@"%@",data[@"comment"]];
}

@end
